/*
 * Copyright  2020  Co.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * 3. Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived from
 *    this software without specific prior written permission.
 */

#ifndef OLED_SSD1306_H
#define OLED_SSD1306_H

#include <stdint.h>

/**
 * @brief ssd1306 OLED Initialize.
 */
uint32_t OledInit(void);

/**
 * @brief Set cursor position
 *
 * @param x the horizontal posistion of cursor
 * @param y the vertical position of cursor
 */
void OledSetPosition(uint8_t x, uint8_t y);

/**
 * @brief fill screen with fillData
 *
 * @param fillData the data to set on the screen
 */
void OledFillScreen(uint8_t fillData);

enum Font {
    FONT6x8 = 1,
    FONT8x16
};
typedef enum Font Font;

/**
 * @brief show a char on the screen
 *
 * @param x the horizontal posistion of the char
 * @param y the vertical position of the char
 * @param ch the char to show
 * @param font the char's font type defined in {@link Font}
 */
void OledShowChar(uint8_t x, uint8_t y, uint8_t ch, Font font);

/**
 * @brief show the string on the screen
 *
 * @param x the horizontal posistion of the string
 * @param y the vertical position of the string
 * @param str the string to show
 * @param font the char's font type defined in {@link Font}
 */
void OledShowString(uint8_t x, uint8_t y, const char* str, Font font);

#endif // OLED_SSD1306_H
